package practice.chat;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.SwingUtilities;

public class Chat extends JFrame{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private JTextField topTxt,downTxt;
	private JButton send;
	public Chat(){
		setSize(600, 500);
		setDefaultCloseOperation(EXIT_ON_CLOSE);
		setTitle("聊天室");
		setLocation(500, 180);
		setVisible(true);
		setLayout(null);
		//JPanel top=new JPanel();
		//add(top);
		//top.setLayout(null);
		//top.setBounds(0, 0, 600, 300);
		topTxt=new JTextField();
		topTxt.setLayout(null);
		topTxt.setBounds(5, 5, 575, 295);
		add(topTxt);
		//top.add(topTxt);
		//JPanel down=new JPanel();
		//add(down);
		//down.setLayout(null);
		//down.setBounds(0, 305, 600, 200);
		downTxt=new JTextField();
		downTxt.setLayout(null);
		downTxt.setBounds(5, 303, 480, 155);
		add(downTxt);
		//down.add(downTxt);
		send=new JButton("发送");
		send.setLayout(null);
		send.setBounds(500, 370, 60, 30);
		add(send);
		
	}
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			
			@Override
			public void run() {
				new Chat();
			}
		});
	}
}
